import request from '@/utils/request'

/* 广告位列表 */
export function selectadvertrule(params) {
  return request({
    url: '/sini/admin/advertrule/selectadvertrule',
    method: 'get',
    params
  })
}
/* 广告位新增 */
export function insertadvertrule(data) {
  return request({
    url: '/sini/admin/advertrule/insertadvertrule',
    method: 'post',
    data
  })
}

/* 广告位编辑 */
export function updateadvertrule(data) {
  return request({
    url: '/sini/admin/advertrule/updateadvertrule',
    method: 'post',
    data
  })
}

/* 广告位删除 */
export function deleteadvertrule(data) {
  return request({
    url: '/sini/admin/advertrule/deleteadvertrule',
    method: 'post',
    data
  })
}

/* 广告位 */
// export function advertrule(data, method) {
//   let requestObj = { url: '/sini/admin/advertrule/advertrule', method }
//   method === 'get' ? (requestObj.params = data) : (requestObj.data = data)
//   return request(requestObj)
// }

/* 时段 */
// export function advertPeriodtime(data, method) {
//   return request({
//     url: '/wx/siniAdvertPeriodtime/advertPeriodtime',
//     method,
//     data
//   })
// }

/* 时段新增 */
export function insertadvertPeriodtime(data) {
  return request({
    url: '/sini/admin/advertPeriodtime/insertadvertPeriodtime',
    method: 'post',
    data
  })
}

/* 时段修改 */
export function updateadvertPeriodtime(data) {
  return request({
    url: '/sini/admin/advertPeriodtime/updateadvertPeriodtime',
    method: 'post',
    data
  })
}



// export function adOrderList(data, method) {
//   let requestObj = { url: '/wx/siniAdvertorder/queryAdvertisement', method }
//   method === 'get' ? (requestObj.params = data) : (requestObj.data = data)
//   return request(requestObj)
// }

/* 广告订单列表 */
export function adOrderList(params) {
  return request({
    url: '/sini/admin/advertorder/queryAdvertisement',
    method: 'get',
    params
  })
}

/* 广告订单审核 */
export function adOrderAudit(data) {
  return request({
    url: '/sini/admin/advertorder/updateAdvertisement',
    method: 'post',
    data
  })
}